import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'substrPipe'
})
export class SubstrPipe implements PipeTransform {

  transform(value: string, args: number): any {
    if(!value) return null;
    if(value.length > args){
      return value.substring(0, args) + '...'
    }else{
      return value
    }
  }
}
